import matplotlib.pyplot as plt
import pandas as pd

plt.rcParams['font.sans-serif'] = ['Microsoft YaHei']  # 指定默认字体：解决plot不能显示中文问题
plt.rcParams['axes.unicode_minus'] = False
data = pd.read_csv("./data/content.csv")
count = data['用户ID'].value_counts().value_counts()

data = count[:6]
data['6以上...'] = sum(count[6:])
index = ['1条', '2条', '3条', '4条', '5条', '6条', '6条以上']

plt.bar(index, data)
plt.title("弹幕数量分析")
plt.show()
